const sequelize = require("../db")
const { DataTypes } = require("sequelize");

const Record = sequelize.define("user_record", {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    user_id:{
        type: DataTypes.INTEGER,
    },
    red_id: DataTypes.INTEGER,
    money: DataTypes.DECIMAL(10,2)
},{
    deletedAt: "deleted_at",
    paranoid: true,
    indexes:[{
            name: 'idx_user_id', // 索引名称
            fields: ['user_id'], // 索引字段
        }
    ]
});



module.exports = Record